/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	ParameterContainer.h
*
*	Description -	
*
*	Comments	-	TODO: Add a way to remove binder.
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	06/19/2012	-	Creation of this file
**************************************************************************************/
#ifndef _PSX_PARAMETER_CONTAINER_H_
#define _PSX_PARAMETER_CONTAINER_H_

#include "PulseSTD.h"
#include "IParameterBinder.h"
#include "Array.h"

namespace Pulse
{
	class ParameterContainer
	{
	public:

		ParameterContainer( void );

		~ParameterContainer( void );

		IParameterBinder * AddParameterBinder( IParameter *pParam );

		IParameterBinder * AddParameterBinder( EParameter::Type paramType, const CHAR *pName );

		IParameterBinder * GetParameterBinder( UINT index );
		
		IParameterBinder * GetParameterBinder( IParameter *pParam );

		BOOL RemoveParameterBinder( const CHAR *pName );

		const SIZE_T GetNumParameterBinders( void ) const { return m_binders.GetSize(); }

		void ClearParameters( void );

		void BindParameters( void );

		EErrorCode::Type ParseParameters( XMLElementPtr pElem );

	private:

		IParameterBinder * CreateBinder( IParameter *pParam );

	private:

		typedef Array<IParameterBinder*> BinderList;

		BinderList m_binders;
	};
}

#endif /* _PSX_PARAMETER_CONTAINER_H_ */
